#!/bin/sh
# 商品搜索：对象类型obj，对象数组objs，Map类型map
curl -XDELETE 'http://localhost:9200/test_item'
curl -XPUT 'http://localhost:9200/test_item'
curl -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/test_item/_mapping?pretty' -d '{
        "properties" : {
                "id" : { "type" : "long" },
                "catId" : { "type" : "keyword" },
                "putTime" : { "type" : "date" },
                "obj" : { 
                	"properties": {
                    "id":{ "type":"long" },
                    "name":{ "type":"keyword" }
                  }
                },
                "list" : { "type" : "keyword" },
                "objs" : { 
                	"properties": {
                    "id":{ "type":"long" },
                    "name":{ "type":"keyword" }
                  }
                },
                "objs1" : { 
                	"type": "nested",
                	"properties": {
                    "id":{ "type":"long" },
                    "name":{ "type":"keyword" }
                  }
                },
                "map" : { 
                	"properties": { }
                },
                "map1" : { 
                	"type": "nested",
                	"properties": { }
                }
        }
}'
curl -H 'Content-Type: application/json' -XPUT 'http://localhost:9200/test_item/_settings' -d '{
        "index" : {  "max_result_window" : 1000000 }
}'
